Integrand size = 25, antiderivative size = 171 \[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=\frac {C \cos (e+f x) (a+a \sin (e+f x))^m}{f \left (2+3 m+m^2\right )}-\frac {2^{\frac {1}{2}+m} \left (C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-m,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x))\right ) (1+\sin (e+f x))^{-\frac {1}{2}-m} (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {C \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)} \]
[Out]
Time = 0.13 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3103, 2830, 2731, 2730} \[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=-\frac {2^{m+\frac {1}{2}} \left (A \left (m^2+3 m+2\right )+C \left (m^2+m+1\right )\right ) \cos (e+f x) (\sin (e+f x)+1)^{-m-\frac {1}{2}} (a \sin (e+f x)+a)^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-m,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x))\right )}{f (m+1) (m+2)}+\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m}{f \left (m^2+3 m+2\right )}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^{m+1}}{a f (m+2)} \]
[In]
[Out]
Rule 2730
Rule 2731
Rule 2830
Rule 3103
Rubi steps \begin{align*} \text {integral}& = -\frac {C \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)}+\frac {\int (a+a \sin (e+f x))^m (a (C (1+m)+A (2+m))-a C \sin (e+f x)) \, dx}{a (2+m)} \\ & = \frac {C \cos (e+f x) (a+a \sin (e+f x))^m}{f \left (2+3 m+m^2\right )}-\frac {C \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)}+\frac {\left (C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) \int (a+a \sin (e+f x))^m \, dx}{(1+m) (2+m)} \\ & = \frac {C \cos (e+f x) (a+a \sin (e+f x))^m}{f \left (2+3 m+m^2\right )}-\frac {C \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)}+\frac {\left (\left (C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) (1+\sin (e+f x))^{-m} (a+a \sin (e+f x))^m\right ) \int (1+\sin (e+f x))^m \, dx}{(1+m) (2+m)} \\ & = \frac {C \cos (e+f x) (a+a \sin (e+f x))^m}{f \left (2+3 m+m^2\right )}-\frac {2^{\frac {1}{2}+m} \left (C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-m,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x))\right ) (1+\sin (e+f x))^{-\frac {1}{2}-m} (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {C \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(1794\) vs. \(2(171)=342\).
Time = 26.44 (sec) , antiderivative size = 1794, normalized size of antiderivative = 10.49 \[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=-\frac {2 \left (A (a+a \sin (e+f x))^m+\frac {1}{2} C (a+a \sin (e+f x))^m-\frac {1}{2} C \cos (2 (e+f x)) (a+a \sin (e+f x))^m\right ) \left (a+\frac {a \tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (\sec ^2(e+f x)+\sqrt {\sec ^2(e+f x)} \tan (e+f x)\right ) \left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^m \left (-\left ((A+C) (3+2 m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2}+m,1+m,\frac {3}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )\right )+4 C (1+2 m) \operatorname {Hypergeometric2F1}\left (\frac {3}{2}+m,3+m,\frac {5}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right ) \left (1+2 \sqrt {\sec ^2(e+f x)} \tan (e+f x)+2 \tan ^2(e+f x)\right )\right )}{f \left (3+8 m+4 m^2\right ) \sqrt {\sec ^2(e+f x)} \left (-\frac {4 m \left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right ) \left (a+\frac {a \tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (\sec ^2(e+f x)+\sqrt {\sec ^2(e+f x)} \tan (e+f x)\right )^2 \left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^{-1+m} \left (-\left ((A+C) (3+2 m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2}+m,1+m,\frac {3}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )\right )+4 C (1+2 m) \operatorname {Hypergeometric2F1}\left (\frac {3}{2}+m,3+m,\frac {5}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right ) \left (1+2 \sqrt {\sec ^2(e+f x)} \tan (e+f x)+2 \tan ^2(e+f x)\right )\right )}{\left (3+8 m+4 m^2\right ) \sqrt {\sec ^2(e+f x)}}+\frac {2 \tan (e+f x) \left (a+\frac {a \tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (\sec ^2(e+f x)+\sqrt {\sec ^2(e+f x)} \tan (e+f x)\right ) \left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^m \left (-\left ((A+C) (3+2 m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2}+m,1+m,\frac {3}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )\right )+4 C (1+2 m) \operatorname {Hypergeometric2F1}\left (\frac {3}{2}+m,3+m,\frac {5}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right ) \left (1+2 \sqrt {\sec ^2(e+f x)} \tan (e+f x)+2 \tan ^2(e+f x)\right )\right )}{\left (3+8 m+4 m^2\right ) \sqrt {\sec ^2(e+f x)}}-\frac {2 m \left (a+\frac {a \tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^{-1+m} \left (\sec ^2(e+f x)+\sqrt {\sec ^2(e+f x)} \tan (e+f x)\right ) \left (a \sqrt {\sec ^2(e+f x)}-\frac {a \tan ^2(e+f x)}{\sqrt {\sec ^2(e+f x)}}\right ) \left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^m \left (-\left ((A+C) (3+2 m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2}+m,1+m,\frac {3}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )\right )+4 C (1+2 m) \operatorname {Hypergeometric2F1}\left (\frac {3}{2}+m,3+m,\frac {5}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right ) \left (1+2 \sqrt {\sec ^2(e+f x)} \tan (e+f x)+2 \tan ^2(e+f x)\right )\right )}{\left (3+8 m+4 m^2\right ) \sqrt {\sec ^2(e+f x)}}-\frac {2 \left (a+\frac {a \tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (\sec ^2(e+f x)^{3/2}+2 \sec ^2(e+f x) \tan (e+f x)+\sqrt {\sec ^2(e+f x)} \tan ^2(e+f x)\right ) \left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^m \left (-\left ((A+C) (3+2 m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2}+m,1+m,\frac {3}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )\right )+4 C (1+2 m) \operatorname {Hypergeometric2F1}\left (\frac {3}{2}+m,3+m,\frac {5}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right ) \left (1+2 \sqrt {\sec ^2(e+f x)} \tan (e+f x)+2 \tan ^2(e+f x)\right )\right )}{\left (3+8 m+4 m^2\right ) \sqrt {\sec ^2(e+f x)}}-\frac {2 \left (a+\frac {a \tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (\sec ^2(e+f x)+\sqrt {\sec ^2(e+f x)} \tan (e+f x)\right ) \left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^m \left (4 C (1+2 m) \operatorname {Hypergeometric2F1}\left (\frac {3}{2}+m,3+m,\frac {5}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right ) \left (2 \sec ^2(e+f x)^{3/2}+4 \sec ^2(e+f x) \tan (e+f x)+2 \sqrt {\sec ^2(e+f x)} \tan ^2(e+f x)\right )+\frac {8 C \left (\frac {3}{2}+m\right ) (1+2 m) \left (\sec ^2(e+f x)+\sqrt {\sec ^2(e+f x)} \tan (e+f x)\right ) \left (1+2 \sqrt {\sec ^2(e+f x)} \tan (e+f x)+2 \tan ^2(e+f x)\right ) \left (-\operatorname {Hypergeometric2F1}\left (\frac {3}{2}+m,3+m,\frac {5}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )+\left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^{-3-m}\right )}{\sqrt {\sec ^2(e+f x)}+\tan (e+f x)}-\frac {2 (A+C) \left (\frac {1}{2}+m\right ) (3+2 m) \left (\sec ^2(e+f x)+\sqrt {\sec ^2(e+f x)} \tan (e+f x)\right ) \left (-\operatorname {Hypergeometric2F1}\left (\frac {1}{2}+m,1+m,\frac {3}{2}+m,-\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )+\left (1+\left (\sqrt {\sec ^2(e+f x)}+\tan (e+f x)\right )^2\right )^{-1-m}\right )}{\sqrt {\sec ^2(e+f x)}+\tan (e+f x)}\right )}{\left (3+8 m+4 m^2\right ) \sqrt {\sec ^2(e+f x)}}\right )} \]
[In]
[Out]
\[\int \left (a +a \sin \left (f x +e \right )\right )^{m} \left (A +C \left (\sin ^{2}\left (f x +e \right )\right )\right )d x\]
[In]
[Out]
\[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=\int { {\left (C \sin \left (f x + e\right )^{2} + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} \,d x } \]
[In]
[Out]
\[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=\int \left (a \left (\sin {\left (e + f x \right )} + 1\right )\right )^{m} \left (A + C \sin ^{2}{\left (e + f x \right )}\right )\, dx \]
[In]
[Out]
\[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=\int { {\left (C \sin \left (f x + e\right )^{2} + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} \,d x } \]
[In]
[Out]
\[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=\int { {\left (C \sin \left (f x + e\right )^{2} + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} \,d x } \]
[In]
[Out]
Timed out. \[ \int (a+a \sin (e+f x))^m \left (A+C \sin ^2(e+f x)\right ) \, dx=\int \left (C\,{\sin \left (e+f\,x\right )}^2+A\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m \,d x \]
[In]
[Out]